<?php
namespace app\common\model;

use think\Model;
use app\common\model\Buyer;

class  Buyer extends Model
{

    public function countryInfo()
    {
        return $this->hasOne('Property', 'id', 'country_id');
    }
    
    public function industryInfo()
    {
        return $this->hasOne('Property', 'id', 'industry_id');
    }

    public function list($country_id,$industry_id)
    {
        $where = [
            ['status' ,'eq', 1],
            ['country_id' ,'eq', $country_id],
            ['industry_id' ,'eq', $industry_id]
        ];
        $order = 'id desc';
        $result = $this->where($where)->order($order)->limit(8)->select();
        return $result;
    }
 
}